/*
 * This is the header file of gb<->big5 conversion.
 * 
 * The gb<->big5 map is extracted from glibc2.3's iconv_data.
 * It can make conversions directly from gb2312-80 to big5 
 * and vice versa, but with some codes unwork! As for gb->big5,
 * there are 599 characters which can not convert to big5, 
 * and for big5->gb,there are about 6000 more characters which
 * can not convert to gb(They are most not-used for common environment).
 *
 * Copyright 2002, Tencent.com
 * Nov. 2002, by Red
 */
#ifndef _gb_big5_h
#define _gb_big5_h

#ifdef __cplusplus
extern "C" {
#endif
		
 /*
  *    Convert null-terminated gb2312 string to big5 string.
  *    @ inptr          input gb2312 string, null-terminated
  *    @ outptr     output big5 string buffer
  *    @ len [in]       output buffer length
  *    return 0 without error, otherwise with errors
  */
int convert_to_big5(const char *inptr, char *outptr, int len);

int convert_to_gb2312(const char *inptr, char *outptr, size_t *len);
int big5u_gb2312(const char *uni, size_t ulen, int byteorder, char *gb2312, size_t *glen);


#define CD_BUFFERLEN	4*1024


#ifdef __cplusplus
}
#endif

#endif /*_gb_big5_h*/
